<!-- 改变主题弹出层 -->


<form class="layui-form">
    <div class="layui-form-item">
        <label class="layui-form-label">顶部导航</label>
        <div class="layui-input-block selecttheme">
            <button type="button" theme-value="red" class="layui-btn layui-bg-red"></button>
            <button type="button" theme-value="orange" class="layui-btn layui-bg-orange"></button>
            <button type="button" theme-value="green" class="layui-btn layui-bg-green"></button>
            <button type="button" theme-value="cyan" class="layui-btn layui-bg-cyan"></button>
            <button type="button" theme-value="blue" class="layui-btn layui-bg-blue"></button>
            <button type="button" theme-value="black" class="layui-btn layui-bg-black"></button>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">当前主题</label>
        <div class="layui-input-block">
            <button type="button" nowtheme class="layui-btn layui-bg-cyan"></button>
        </div>
    </div>
</form>
<script>
    $(function(){
        $("button[nowtheme]").attr("class","layui-btn layui-bg-" + nowTheme);
    });
    $(".selecttheme button[theme-value]").click(function(){
        var themeValue = $(this).attr("theme-value");
        setCookie("TS_Admin_Theme",themeValue);
        historyTheme = nowTheme;
        nowTheme = themeValue;
        $("button[nowtheme]").attr("class","layui-btn layui-bg-" + themeValue);
        doTheme();
    });
</script>